﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace DataLayer
{
    public class UsersDL:BaseDL
    {        
        /// <summary>
        /// gets all user information for the specified user
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public DataSet getUserByUsername(string username)
        {
            this._storedProcedureName = "getUserByUsername";
            this._params = new SqlParameter[] { 
                                                new SqlParameter("@Username",username)
                                                
                                              };

            return this.getDataSet();
        }
        /// <summary>
        /// Saves additional User Related information
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="FirstName"></param>
        /// <param name="LastName"></param>
        /// <param name="Address"></param>
        /// <param name="City"></param>
        /// <param name="State"></param>
        /// <param name="Zip"></param>
        /// <param name="Phone"></param>
        public void saveAdditionalUserInfo(string UserName, string FirstName, string LastName, string Address, string City, string State, string Zip, string Phone)
        {
            this._storedProcedureName = "updateUserInfomation";
            this._params = new SqlParameter[] { 
                                                new SqlParameter("@FirstName",FirstName),
                                                new SqlParameter("@LastName",LastName),
                                                new SqlParameter("@Address",Address),
                                                new SqlParameter("@City",City),
                                                new SqlParameter("@State",State),
                                                new SqlParameter("@Zip",Zip),
                                                new SqlParameter("@Phone",Phone),
                                                new SqlParameter("@UserName",UserName)
                                              };

            this.executeProcedure();
        }

        
    }
}
